import random

while True:
    player = int(input("玩家请输入石头1/剪刀2/布3/退出0:"))
    if player == 0 :
        print("欢迎下次再来！")
        break
    computer = random.randint(1,3)
    if player == 1 and computer == 2 or player == 2 and computer == 3 or player == 3 and computer == 1:
        print("恭喜你取得胜利！")
    elif player == computer:
        print("平局！")
    else:
        print("胜败乃兵家常事，请少侠重新再来！")

